package org.tong.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.record.Record;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author
 * @date 2022-11-15 20:16
 */
@Component
public class KafkaConsumer {

    @KafkaListener(topics = {"test-msg"})
    public void testConsumer(ConsumerRecord<String, String> record) {
        System.out.println("收到了消息：" + record);
    }
}
